using System.ComponentModel.DataAnnotations;

namespace Hospital.Domain
{
    /// <summary>
    /// 开单记录表
    /// </summary>
    public class OrderRecord
    {
        /// <summary>
        /// 开单记录ID
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 院区ID
        /// </summary>
        [Required]
        public int HospitalBranchId { get; set; }

        /// <summary>
        /// 检查项目ID
        /// </summary>
        [Required]
        public int CheckItemId { get; set; }

        /// <summary>
        /// 检查项目总数
        /// </summary>
        [Required]
        public int ItemCount { get; set; }

        /// <summary>
        /// 总费用
        /// </summary>
        [Required]
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// 支付状态：未支付、已支付、已完成、已取消
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string PaymentStatus { get; set; } = "未支付";

        /// <summary>
        /// 开单时间
        /// </summary>
        [Required]
        public DateTime OrderTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 患者姓名
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string PatientName { get; set; } = string.Empty;

        /// <summary>
        /// 患者身份证号
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string PatientIdCard { get; set; } = string.Empty;

        /// <summary>
        /// 申请原因
        /// </summary>
        [MaxLength(500)]
        public string ApplicationReason { get; set; } = string.Empty;

        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? PaymentTime { get; set; }

        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? CompletedTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(500)]
        public string? Remarks { get; set; }

        /// <summary>
        /// 删除标记
        /// </summary>
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdatedTime { get; set; }

        /// <summary>
        /// 导航属性：关联的院区
        /// </summary>
        public virtual HospitalBranch? HospitalBranch { get; set; }

        /// <summary>
        /// 导航属性：关联的检查项目
        /// </summary>
        public virtual CheckItem? CheckItem { get; set; }
    }
} 